<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>

<sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
    select * From Competencias_Docentes d
    inner join Componentes_Competencias p on d.id_competencia=p.id_competencia
    inner join Componentes c on c.id_componente=p.id_componente
    where matricula=?
    order by c.desc_componente
    <sql:param value="${param.matricula}"/>
</sql:query>
<c:choose>
    <c:when test="${!empty query.rows}">
        <label class="lbInput">Componente<em>*</em></label>
        <select name="id_componente" class="required" onchange="getCursosComponente()">
            <option value="">Selecione um componente</option>
            <c:forEach var="row" items="${query.rows}">
                <option value="${row.id_componente}" ${row.id_componente==param.id_componente?'selected':''}>${row.desc_componente}</option>
            </c:forEach>
        </select>
    </c:when>
    <c:otherwise>
        <p style="font-size: 12pt; color: red">Nenhum componente foi encontrado para o Docente.</p>
    </c:otherwise>

</c:choose>

